﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace template_dll
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
        }

        private void Form4_Load(object sender, EventArgs e)
        {
            this.Text = "Редактирование товара";
            this.textBox1.Text = ((Form3)template_dll.Form3.cMain.Form3Control).drug_code;
            this.textBox2.Text = ((Form3)template_dll.Form3.cMain.Form3Control).drug_name;
            this.textBox3.Text = ((Form3)template_dll.Form3.cMain.Form3Control).delta;
            this.comboBox1.SelectedIndex = ((Form3)template_dll.Form3.cMain.Form3Control).sign;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //- Сохранить и выйти
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //- Закрыть без сохранения
            this.Close();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //- Знак дельты
            ((Form3)template_dll.Form3.cMain.Form3Control).sign = this.comboBox1.SelectedIndex;
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            //- Внести значение дельты
            ((Form3)template_dll.Form3.cMain.Form3Control).delta =this.textBox3.Text.ToString();
        }
    }
}
